package sample.client;

import java.util.List;

import com.google.gwt.event.shared.HandlerManager;

import sample.client.view.gxt.Document;
import sample.shared.result.Client;

abstract public class CMModelBase implements CMModel
{
  protected HandlerManager eventBus;
  
  private Client client;
  
  private String clientNameText;
  
  private String clientCodeText;
  
  private String fileYear;
  
  private String uploadFileName;
  
  private boolean gotoEnabled;
  
  private boolean uploadEnabled;

  /* (non-Javadoc)
   * @see sample.client.CMModel#setClientNameText(java.lang.String)
   */
  @Override
  public void setClientNameText(String clientNameText) {
    this.clientNameText = clientNameText;
  }

  /* (non-Javadoc)
   * @see sample.client.CMModel#setClientCodeText(java.lang.String)
   */
  @Override
  public void setClientCodeText(String clientCodeText) {
    this.clientCodeText = clientCodeText;
  }

  /* (non-Javadoc)
   * @see sample.client.CMModel#isGotoEnabled()
   */
  @Override
  public boolean isGotoEnabled() {
    return gotoEnabled;
  }

  /* (non-Javadoc)
   * @see sample.client.CMModel#setGotoEnabled(boolean)
   */
  @Override
  public void setGotoEnabled(boolean gotoEnabled) {
    this.gotoEnabled = gotoEnabled;
  }

  /* (non-Javadoc)
   * @see sample.client.CMModel#isUploadEnabled()
   */
  @Override
  public boolean isUploadEnabled() {
    return uploadEnabled;
  }

  /* (non-Javadoc)
   * @see sample.client.CMModel#setUploadEnabled(boolean)
   */
  @Override
  public void setUploadEnabled(boolean uploadEnabled) {
    this.uploadEnabled = uploadEnabled;
  }

  /* (non-Javadoc)
   * @see sample.client.CMModel#getClientNameText()
   */
  @Override
  public String getClientNameText() {
    return clientNameText;
  }

  /* (non-Javadoc)
   * @see sample.client.CMModel#getClientCodeText()
   */
  @Override
  public String getClientCodeText() {
    return clientCodeText;
  }

  /* (non-Javadoc)
   * @see sample.client.CMModel#getFileYear()
   */
  @Override
  public String getFileYear() {
    return fileYear;
  }

  /* (non-Javadoc)
   * @see sample.client.CMModel#setFileYear(java.lang.String)
   */
  @Override
  public void setFileYear(String fileYear) {
    this.fileYear = fileYear;
  }

  List<Document> foundFiles;

  /* (non-Javadoc)
   * @see sample.client.CMModel#getClient()
   */
  @Override
  public Client getClient() {
    return client;
  }

  /* (non-Javadoc)
   * @see sample.client.CMModel#setClient(sample.shared.result.Client)
   */
  @Override
  public void setClient(Client client) {
    this.client = client;
  }

  /* (non-Javadoc)
   * @see sample.client.CMModel#getUploadFileName()
   */
  @Override
  public String getUploadFileName() {
    return uploadFileName;
  }

  /* (non-Javadoc)
   * @see sample.client.CMModel#setUploadFileName(java.lang.String)
   */
  @Override
  public void setUploadFileName(String uploadFileName) {
    this.uploadFileName = uploadFileName;
  }
  
  /* (non-Javadoc)
   * @see sample.client.CMModel#onUpload()
   */
  @Override
  abstract public void onUpload();
  
  /* (non-Javadoc)
   * @see sample.client.CMModel#onClientNameChanged()
   */
  @Override
  abstract public void onClientNameChanged();

  /* (non-Javadoc)
   * @see sample.client.CMModel#getEventBus()
   */
  @Override
  public HandlerManager getEventBus() {
    return eventBus;
  }
}
